<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>游戏房间</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/game_room.css">
    <style>
        /* 新增聊天区域样式 */
        .chat-container {
            margin-top: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            width: 450px;
        }
        .chat-messages {
            height: 200px;
            border: 1px solid #ccc;
            border-radius: 5px;
            padding: 10px;
            overflow-y: auto;
            background-color: #f9f9f9;
        }
        .chat-input {
            display: flex;
            gap: 10px;
        }
        #messageInput {
            flex: 1;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
        }
        #sendBtn {
            padding: 8px 16px;
            background-color: #4CAF50;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
        }
        .message {
            margin: 5px 0;
            padding: 5px;
            border-radius: 4px;
        }
        .my-message {
            background-color: #e1f5fe;
            text-align: right;
        }
        .other-message {
            background-color: #e8f5e9;
            text-align: left;
        }
    </style>
</head>
<body>

    <div class="nav">五⼦棋对战</div>
    <div class="container">
        <div class="game-content">
            <!--棋盘区域,使用canvas实现  -->
            <canvas id="chess" width="450px" height="450px"></canvas>

            <div id="screen">等待玩家连接中...</div>

            <!-- 新增聊天区域 -->
            <div class="chat-container">
                <div class="chat-messages" id="chatMessages"></div>
                <div class="chat-input">
                    <input type="text" id="messageInput" placeholder="输入消息...">
                    <button id="sendBtn">发送</button>
                </div>
            </div>

        </div>
    </div>
    <script src="./js/script.js"></script>

</body>
</html>